﻿ function GetRandomArr(Min, Max) {

            var array = new Array();

            var cha=Max-Min;

            for (var i = 0; ; i++) {
                if (array.length < cha) {
                    //产生随机数 0到count不包含count的随机数
                    var randomNub = Min+(Math.floor(Math.random() * cha));

                    //Jquery判断数组array中是否包含元素randomNub
                    if (-1 == $.inArray(randomNub, array)) {

                        array.push(randomNub);

                    }
                }else{
                    break;
                }
            }
            return array;
        }
        $(function(){
            $(".b_topNav_liBox").hover(function (){
                $(this).find(".b_topNav_a").slideDown(20);
                $(this).find(".b_topNav_a").addClass("addBorderType");
            },function (){
                $(this).find(".b_topNav_a").slideUp(0);
                $(this).find(".b_topNav_a").removeClass("addBorderType");
            });
            var demo1 = new CountUp("Num", 0,20, 0, 2, options);
            var demo2 = new CountUp("myTargetElement2", 0,100, 0, 3, options);
            var l = $(".se3_List li");

             var arr=['<img src="/dfile/style/img/partner/1.png" alt=""/>','<img src="/dfile/style/img/partner/2.png" alt=""/>','<img src="/dfile/style/img/partner/3.png" alt=""/>','<img src="/dfile/style/img/partner/4.png" alt=""/>','<img src="/dfile/style/img/partner/5.png" alt=""/>','<img src="/dfile/style/img/partner/6.png" alt=""/>','<img src="/dfile/style/img/partner/7.png" alt=""/>','<img src="/dfile/style/img/partner/8.png" alt=""/>','<img src="/dfile/style/img/partner/9.png" alt=""/>',
                 '<img src="/dfile/style/img/partner/10.png" alt=""/>','<img src="/dfile/style/img/partner/11.png" alt=""/>','<img src="/dfile/style/img/partner/12.png" alt=""/>','<img src="/dfile/style/img/partner/13.png" alt=""/>','<img src="/dfile/style/img/partner/14.png" alt=""/>','<img src="/dfile/style/img/partner/15.png" alt=""/>','<img src="/dfile/style/img/partner/16.png" alt=""/>','<img src="/dfile/style/img/partner/17.png" alt=""/>',
                 '<img src="/dfile/style/img/partner/18.png" alt=""/>','<img src="/dfile/style/img/partner/19.png" alt=""/>','<img src="/dfile/style/img/partner/20.png" alt=""/>','<img src="/dfile/style/img/partner/21.png" alt=""/>'];
    var arr1=['<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>',
        '<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>',
        '<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i55.png" alt=""/>'];
    var arr4=['<img src="http://static.98ep.com/Img/GroupPortal/i27.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i28.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i29.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i30.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i31.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i32.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i33.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i34.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i35.png" alt=""/>',
        '<img src="http://static.98ep.com/Img/GroupPortal/i36.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i37.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i38.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i39.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i40.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i41.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i42.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i43.png" alt=""/>',
        '<img src="http://static.98ep.com/Img/GroupPortal/i44.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i45.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i46.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i47.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i48.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i49.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i50.png" alt=""/>','','<img src="http://static.98ep.com/Img/GroupPortal/i51.png" alt=""/>','<img src="http://static.98ep.com/Img/GroupPortal/i52.png" alt=""/>'];
            l.each(function(i){
                $(this).append(arr[i]).css({"top":"110px","left":"480px","opacity":1});
            });
            function autoTypeWH() {
                var row = 1;
                var _top = 0;
                var left1 = 145;
                if($(window).width()>1500){
                    left1=160;
                }


                var left2 = 0;
                var node = 0;
                var t = null;
                var t2 = null;
                var t3 = null;
                $(".se3_List").show();
                l.each(function(i){
                    var g = i+1;
                    if(row % 2 == 0){
                        node ++;
                        $(this).css({"top":_top,"left":left2});

                        if($(window).width()>1500){
                            left2 += 320;
                        }else{
                            left2 += 280;
                        }

                        if(node == 4){
                            row++;
                            if($(window).width()>1500){
                                _top += 55;
                            }else{
                                _top += 50;
                            }
                            node = 0;
                            left2 =0;
                        }
                    }else{
                        node++;
                        $(this).css({"top":_top,"left":left1});
                        if($(window).width()>1500){
                            left1 += 320;
                        }else{
                            left1 += 280;
                        }
                        if (node == 3){
                            row++;
                            if($(window).width()>1500){
                                _top += 55;
                            }else{
                                _top += 50;
                            }
                            node = 0;
                            if($(window).width()>1500){
                                left1 = 160;
                            }else{
                                left1 = 145;
                            }
                        }
                    }
                });
            }


            $(".se4_List li").each(function(i){
                $(this).append(arr1[i]);
            });

            var isTrue=false;
            var isTrue1=false;
            var isTrue2=false;
            var isTrue3=false;
            var isTrue4=false;
            var isTrue5=false;
	        var timesList2=null;
            var itTrueRofalse=true;
            $('#dowebok').fullpage({
                sectionsColor: ['#2f86ef' , '#f2f2f2', '#f7f8f9', '#fff','#e9f3ff'],
                'navigation': true,
                afterLoad: function(anchorLink, index){
                    if(index==1){
                        
                    }
                    if(index == 2){
                        if(isTrue2==true){
                             $(".se2_List li .doIt").css("opacity","1");
                            clearTimeout(timesList2);
                        }else{
                            isTrue2=true;
                            $(".se2W").addClass("bounceInLeft animated").css("transform","translate3d(0, 0, 0)");
                            var n = $(".se2_List li").length;
                            var _index = 0;
                            timesList2 =   setInterval(function(){
                                if(_index == n+1){
                                    clearTimeout(timesList2);
                                }else{
                                    $(".se2_List li .doIt").eq(_index).css("opacity","1");

                                }
                                _index++;
                            },500);
                        }
                    
                    }
                    if(index == 3){
                if(isTrue3==true){
                    $(".se2_List li .doIt").css("opacity","1");
                    clearTimeout(timesList2);
                }else{
                    isTrue3=true;
                    var arr2 = GetRandomArr(0,27);
                    demo2.start();
                    demo1.start();
                    var _n = 0;


                }

            }
                    if(index == 4){
                        if(isTrue4==true){
                            $(".se2_List li .doIt").css("opacity","1");
                            clearTimeout(timesList2);
                        }else{
                            isTrue4=true;
                            $(".dot1").addClass("bounceInLeft animated").show();
                            if(hasSVG()){
                                setTimeout(function(){
                                    var arr3 = new Array();
                                    arr3.push("pause");

                                    var max_x=200+parseInt(Math.random()*200);
                                    var max_y=100+parseInt(Math.random()*100);
                                    var obj = {};
                                    var height=0;
                                    var plus=0;
                                    var step=60;
                                    var start_x=parseInt(Math.random()*500),start_y=parseInt(Math.random()*500);
                                    arr3.push({"x":start_x,"y":start_y});
                                    while(height<800) {
                                        for (k = 0; k < (100+plus*step*2); k++) {
                                            var mm = parseInt(Math.random()*100);
                                            if(k==0 || k==(100+plus*step*2-1) || k==mm)
                                            {
                                                var nn = parseInt(Math.random()*100);
                                                obj = {};
                                                obj.x = max_x+plus*step+nn;
                                                obj.y = max_y+plus*step;
                                                arr3.push(obj);
                                            }
                                            if(plus%2==1)
                                            {
                                                max_x++;
                                                max_y--;
                                            }
                                            else {
                                                max_x--;
                                                max_y++;
                                            }
                                        }
                                        height+=6;
                                        plus++;

                                    }
                                    //                        console.log(JSON.stringify(arr3))
                                    var wipe = new Wipe({
                                        el: '#wipe',
                                        fg: '#fff',
                                        size: 140,
                                        debug: false,
                                        autoWipe: true,
                                        data: arr3,
                                        onswiping: function (percent) {

                                        }
                                    });
                                },500);
                            }else{
                                $("#b_mask").hide();
                                $("#b_canvas_four").hide();
                                var b_len=$(".se4_List img").length;
                         for(var j=0;j<b_len;j++){
                            $(".se4_List img").eq(j).attr('src',"/ierp/dfile/style/c"+(j+1)+".png?v=1");
                         }
                         $(".link--kukuri").addClass("link_kukuri_addColor");
                            }
                        }

                        
                    }
                    if(index==5){
                        if(isTrue5==true){
                            $(".se2_List li .doIt").css("opacity","1");
                            clearTimeout(timesList2);
                        }else {
                            isTrue5 = true;
                            $(".mapBox").addClass("zoomIn animated").show();
                        }
                        $(".mapBox canvas").css({cursor:"default"});
                        // 检测宽度变化
                        (function () {
                            function o() {
                                canvasApp();
                            }
                            var e = null;
                            $(window).resize(function () {
                                clearTimeout(e), e = setTimeout(o, 300)
                            }), o()
                        })(window);
                    
                    }
                },
                onLeave: function(index, direction){
                    if(index == 1){
                        if(!isTrue4){
                            $("#b_mask").addClass("b_canvas_four_hideColor");
                        }else{
                            $("#b_mask").removeClass("b_canvas_four_hideColor");
                            $("#b_mask").css({opacity:0});
                        }
                    }if(index==2){
                        if(!isTrue4){
                            $("#b_mask").addClass("b_canvas_four_hideColor");
                        }else{
                            $("#b_mask").removeClass("b_canvas_four_hideColor");
                             $("#b_mask").css({opacity:0});
                        }
                    }
                    if(index == '3'){
                        if(!isTrue4){
                            $("#b_mask").addClass("b_canvas_four_hideColor");
                        }else{
                            $("#b_mask").removeClass("b_canvas_four_hideColor");
                             $("#b_mask").css({opacity:0});
                        }
                    }
                    if(index==4){
                        $("#b_canvas_four").hide();
                    }
                    if(index==5){
                        if(!isTrue4){
                            $("#b_mask").addClass("b_canvas_four_hideColor");
                        }else{
                            $("#b_mask").removeClass("b_canvas_four_hideColor");
                             $("#b_mask").css({opacity:0});
                        }

                    }

                }
            });
            function getHeight() {
                var banWidth=$(window).width();
                if(banWidth>1800){
                    $(".se3_Title").css({"paddingTop":"15%"});
                    $(".se2_Title").css({"paddingTop":"15%"});
                }else if(banWidth<=1800 && banWidth>1360){
                    $(".se3_Title").css({"paddingTop":"10%"});
                    $(".se2_Title").css({"paddingTop":"10%"});
                }else if(banWidth<=1440 && banWidth>=1280){
                    $(".se3_Title").css({"paddingTop":"10%"});
                    $(".se2_Title").css({"paddingTop":"10%"});
                }else{
                    $(".se3_Title").css({"paddingTop":"7%"});
                    $(".se2_Title").css({"paddingTop":"7%"});
                }
            }
            // 检测高度变化
            (function () {
                function o() {
                    getHeight();
                    autoTypeWH();
                    if($(window).width()>=1500){
                        $("#svg1").css({height:"490px","width":"800px"});
                    }else{
                        $("#svg1").css({height:"368px","width":"600px"});
                    }
                    // utils.detailMove();
                }
                var e = null;
                $(window).resize(function () {
                    clearTimeout(e), e = setTimeout(o, 300)
                }), o()
            })(window);
        });


 function hasSVG(){
    return !! document.createElementNS &&
        !! document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect
}